function Dog(name){
    this.name = name
    this.getName=function(){
        return this.name
    }
}
let daHuang = new Dog('大黄')
console.log(daHuang.getName()) 

function myNew(fn,...args){
    let obj = {}
    obj.__proto__ = fn.prototype
    fn.apply(obj, args)
    return obj;
}
let xiaoHuang = myNew(Dog,'小黄')
console.log(xiaoHuang.getName())